#include <stdio.h>
#include <dlfcn.h>


int main()
{
    typedef int (*FUN)(int); 
    
    void *handle = dlopen("file.so", RTLD_LAZY);
    
    FUN f = FUN(dlsym(handle, "factorial"));
    
    printf ("%d\n", (*f)(5));
    
    return 0;
}


